<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>
		<div id="spans"></div>
		<script>
			var str = "";
			var person = new Object();

			person.name = "工程师";
			alert(this.name);
			person.age = "22";
			person.job = "java工程师";
			person.address = "安徽合肥";

			person.writes = function() {
				//				alert(this.name);
				var doc = document.getElementById("spans");
				str = "姓名：" + this.name + "<br/>" + "年龄:" + this.age + "工作：" + "<br/>" + this.job + "<br/>" + "地址：" + this.address;
				doc.innerHTML = str;
			}
			person.writes();

			alert(str);
		</script>
	</body>

</html>